def get_cflags_and_libs(root):
+ if os.environ.get('USE_SHARED_SENTENCEPIECE') == '1':
+ include_dirs = os.environ['SENTENCEPIECE_INCLUDE_DIR']
+ library_dir = os.environ['SENTENCEPIECE_LIBRARY_DIR']
+ cflags = ['-std=c++17']
+ for include_dir in include_dirs.split(os.pathsep):
+ if include_dir:
+ cflags.append('-I' + os.path.normpath(include_dir))
+ return cflags, [
+ '-L' + os.path.normpath(library_dir),
+ '-lsentencepiece',
+ '-lsentencepiece_train',
+ ]
cflags = [
'-std=c++17',
'-I' + os.path.normpath(os.path.join(root, 'include')),